/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-05-05
 * Time:15:13
 */
class Body{
    private String manufactor;
    private double price;

    public Body(String manufactor, double price) {
        this.manufactor = manufactor;
        this.price = price;
    }

    public double getPrice() {
        return price;
    }

    public String getManufactor() {
        return manufactor;
    }
}

class Refills{
    private String manufactor;
    private double price;

    public Refills(String manufactor, double price) {
        this.manufactor = manufactor;
        this.price = price;

    }

    public String getManufactor() {
        return manufactor;
    }

    public double getPrice() {
        return price;
    }
}

class BallPen{
    private String brand;
    private Body body;
    private Refills refills;

    public BallPen(String brand, Body body, Refills refills) {
        this.brand = brand;
        this.body = body;
        this.refills = refills;
    }

    public void showMessage(){
        System.out.println("圆珠笔品牌："+this.brand+";"+"成本价格："+(this.body.getPrice()+this.refills.getPrice()));
        System.out.println("笔身制造商："+this.body.getManufactor()+";"+"价格："+this.body.getPrice());
        System.out.println("笔芯制造商："+this.refills.getManufactor()+";"+"价格："+this.refills.getPrice());

    }
}



public class TestDemo4 {
    public static void main(String[] args) {
        Body body=new Body("晨光",1.00);
        Refills refills=new Refills("爱好",2.00);
        BallPen ballPen=new BallPen("晨光",body,refills);
        ballPen.showMessage();
    }
}
